<template>
  <a-tooltip placement="bottom" >
    <template slot="title">
      <div :class="{'tooltip-title-align-center': alignCenter }">
        <span v-if="toolTip" v-html="toolTip"></span>
        <span v-else-if="text" v-html="text"></span>
        <span v-else>
          <slot/>
        </span>
      </div>
    </template>
    <div class="gb-long-text" :style="{width: (width == '100%' ? width : width + 'px')}">
      <span v-if="text" v-html="text"></span>
      <slot v-else/>
    </div>
  </a-tooltip>
</template>

<script>
export default {
  props: {
    width: { type: [String, Number], default: '100%' },
    text: { type:[String] },
    toolTip: { type:[String] },
    alignCenter: { type:[Boolean], default: false },
  },
  data() {
    return {}
  }
}
</script>

<style scoped>
.tooltip-title-align-center {
  text-align: center;
}
</style>